package com.jerry.config;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import java.util.concurrent.locks.ReentrantReadWriteLock;

@Data
@Slf4j
@Configuration
@ConfigurationProperties("client")
public class ClientConfig {
    private String metaServerHost;
    private String metaServerPort;
    private String workSpace;

    public String getMetaServerAddress() {
        log.info("{}",metaServerHost);
        log.info("{}",metaServerPort);
        return String.format("%s:%s", metaServerHost, metaServerPort);
    }

    @Bean
    public ReentrantReadWriteLock reentrantReadWriteLock(){
        return new ReentrantReadWriteLock();
    }
}
